package com.ListViewTest;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Log;

public class Items {

	private String Title;
	private String Content;
	private String imageURL = null;

	public Items(String _Title, String _Content) {
		this.Title = _Title;
		this.Content = _Content;
	}

	public Items(String _Title, String _Content, String _imageURL) {
		// TODO Auto-generated constructor stub
		this.Title = _Title;
		this.Content = _Content;
		this.imageURL = _imageURL;
	}

	public Bitmap getImage() {
		// TODO Auto-generated method stub
		Bitmap img = null;
		
		try {
			URL url = new URL(imageURL);
			URLConnection conn = url.openConnection();
			conn.connect();
			BufferedInputStream bis = new BufferedInputStream(conn
					.getInputStream());
			img = BitmapFactory.decodeStream(bis);
			bis.close();
		} catch (IOException e) {
			Log.e("exc", " ", e);
		}
		return img;
	}

	public String getContent() {
		// TODO Auto-generated method stub
		return Content;
	}

	public CharSequence getTitle() {
		// TODO Auto-generated method stub
		return Title;
	}
}